package org.swift.mashup.engine.concurrency.memory;

import java.util.Collection;

import org.w3c.dom.Node;

@SuppressWarnings("unchecked")
public abstract class MemoryItem {
	protected int id;	
	protected MemoryType type;
	public int position;
	public int length;
	protected WorkingMemory workingMemory;

	protected MemoryItem(int id, MemoryType type) {
		this.id = id;		
		this.type = type;
	}

	public int getId() {
		return id;
	}

	public MemoryType getType() {
		return type;
	}
	
	public abstract String toXML();

	public abstract Node toNode();

	public abstract Collection toCollection();
	
	public abstract Object getValue();
	
	public int getLength() {
		return 1;
	}
}
